package com.gomtel.smartdevice.ui.dialog;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.StyleRes;
import android.view.View;
import android.widget.RadioButton;

import com.gomtel.smartdevice.R;
import com.gomtel.smartdevice.base.WatchBaseDialog;
import com.gomtel.smartdevice.moudle.event.EventCode;
import com.gomtel.smartdevice.ui.activity.MultiTypeActivity;
import com.gomtel.smartdevice.ui.activity.tools.PedometerActivity;
import com.gomtel.smartdevice.utils.SystemUtil;
import com.gomtel.smartdevice.utils.ToastUtil;

import butterknife.BindView;


/**
 * Created by Administrator on 2018/3/21.
 */

public class StepAboutDialog extends WatchBaseDialog implements View.OnClickListener {

    @BindView(R.id.life)
    RadioButton life;
    @BindView(R.id.center)
    RadioButton center;
    @BindView(R.id.right)
    RadioButton right;

    private Context context;
    private ToastUtil toastUtil;

    protected StepAboutDialog(Context context, @StyleRes int themeResId) {
        super(context, themeResId);
        this.context = context;
    }

    @Override
    protected int getLayout() {
        return R.layout.dialog_step_about;
    }

    @Override
    protected void initClass() {
        toastUtil = new ToastUtil(context);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initListener() {
        life.setOnClickListener(this);
        center.setOnClickListener(this);
        right.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.life:
                Intent intent = new Intent(context, MultiTypeActivity.class);
                intent.putExtra("ActionType", String.valueOf(EventCode.CALORY));
                context.startActivity(intent);
                break;
            case R.id.center:
                context.startActivity(new Intent(context, PedometerActivity.class));
                break;
            case R.id.right:
                toastUtil.showToast("暂未开放");
//                context.startActivity(new Intent(context, DeviceSettingActivity.class));
                break;
        }
        dismiss();
    }

    @Override
    protected void onDismissListener() {
        super.onDismissListener();
        SystemUtil.windowToLight(context);
    }


}
